﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;



namespace GWModflow.FileLayers
{
    public  class PDirectSolver:Package
    {

        public PDirectSolver()
        {
            this._fileType = FileType.DE4;

            this.Fname = "solution.de4";

            this.Nunit = 31;
        }

        int _ITMX;

        /// <summary>
        /// 每次时间循环的最大迭代次数
        /// </summary>
        public int ITMX
        {
            get { return _ITMX; }
            set { _ITMX = value; }
        }


        int _MAXUP;

        public int MAXUP
        {
            get { return _MAXUP; }
            set { _MAXUP = value; }
        }

        int _MXLOW;

        public int MXLOW
        {
            get { return _MXLOW; }
            set { _MXLOW = value; }
        }

        double _MXBW;

        /// <summary>
        /// 最大频带宽度，AL乘以1
        /// </summary>
        public double MXBW
        {
            get { return _MXBW; }
            set { _MXBW = value; }
        }


        int _IFREQ;

        /// <summary>
        /// 表明频率系数变化标志
        /// </summary>
        public int IFREQ
        {
            get { return _IFREQ; }
            set { _IFREQ = value; }
        }


        int _MUTD4;

        /// <summary>
        /// 输出控制,MUTD4=0，补偿的迭代次数和每次迭代最大水头变化输出
        /// MUTD4=1，仅输出步长的迭代次数
        ///MUTD4=0，不打印任何信息
        /// </summary>
        public int MUTD4
        {
            get { return _MUTD4; }
            set { _MUTD4 = value; }
        }

        double _ACCL;



        public double ACCL
        {
            get { return _ACCL; }
            set { _ACCL = value; }
        }

        double _HCLOSE;
        public double HCLOSE
        {
            get { return _HCLOSE; }
            set { _HCLOSE = value; }
        }

        int _IPRD4;

        /// <summary>
        /// 仅在使用迭代时（ITMX>1），使用。任何情况都需写入到inp文件。打印输出间隔
        /// </summary>
        public int IPRD4
        {
            get { return _IPRD4; }
            set { _IPRD4 = value; }
        }



        public override void WriteFile(string path)
        {
            string content = "# HuanAnKeJi DE4 File" + "\r\n";
            content += this.ITMX + "  " + this.MAXUP + "  " + this.MXLOW + "  " + MXBW + "\r\n";
            content += this.IFREQ + "  " + this.MUTD4 + "  " + this.ACCL + "  " + this.HCLOSE + "  " + this.IPRD4 + "\r\n";
            string fname = path +this.Fname;


            FXnaInfrastructure.FileHelper.WriteFile(fname ,content );

        }

    }
}
